﻿// Copyright 2009 Mike Geise
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Falcon.Forums.Domain.Services
{
	using System.Collections.Generic;
	using Falcon.Core.Collections;
	using Falcon.Forums.Domain.Enums;
	using Falcon.Forums.Domain.Values;

	public interface IForumTopicService
	{
		/// <summary>
		/// Gets the forum topic by the specified specification.
		/// </summary>
		/// <param name="specification">The specification.</param>
		/// <returns></returns>
		ForumTopic GetBy(ForumTopicSpecification specification);

		/// <summary>
		/// Gets the forum topic by id.
		/// </summary>
		/// <param name="id">The id.</param>
		ForumTopic GetById(int id);

		/// <summary>
		/// Gets all the forum topics by the specified specification.
		/// </summary>
		/// <param name="specification">The specification.</param>
		IPagedList<ForumTopic, ForumTopicSpecification> GetPaged(ForumTopicSpecification specification);

		/// <summary>
		/// Gets the count of topics by the specified specification.
		/// </summary>
		/// <param name="specification">The specification.</param>
		/// <returns></returns>
		int Count(ForumTopicSpecification specification);

		/// <summary>
		/// Creates the forum topic.
		/// </summary>
		ForumTopic Create();

		/// <summary>
		/// Inserts the forum topic into the storage.
		/// </summary>
		/// <param name="topic">The <see cref="ForumTopic"/>.</param>
		void Insert(ForumTopic topic);

		/// <summary>
		/// Inserts the forum topic into the storage.
		/// </summary>
		/// <param name="topic">The <see cref="ForumTopic"/>.</param>
		/// <param name="value">The <see cref="ForumTopicCreate"/>.</param>
		void Insert(ForumTopic topic, ForumTopicCreate value);

		/// <summary>
		/// Updates the specified forum topic in the storage..
		/// </summary>
		/// <param name="topic">The <see cref="ForumTopic"/>.</param>
		void Update(ForumTopic topic);

		/// <summary>
		/// Updates the specified topics.
		/// </summary>
		/// <param name="topics">The topics.</param>
		/// <param name="action">The action.</param>
		void Update(IList<ForumTopic> topics, ForumTopicAction action);

		/// <summary>
		/// Deletes the specified forum topic in the storage.
		/// </summary>
		/// <param name="topic">The <see cref="ForumTopic"/>.</param>
		void Delete(ForumTopic topic);

		/// <summary>
		/// Deletes the topics specified in <see cref="ForumTopicDelete"/>.
		/// </summary>
		/// <param name="value">The value.</param>
		void Delete(ForumTopicDelete value);

		/// <summary>
		/// Deletes the topics specified in <see cref="ForumTopicDeleteSpam"/>.
		/// </summary>
		/// <param name="value">The value.</param>
		void Delete(ForumTopicDeleteSpam value);

		/// <summary>
		/// Moves the topics specified in <see cref="ForumTopicMove"/>.
		/// </summary>
		/// <param name="value">The <see cref="ForumTopicMove"/>.</param>
		void Move(ForumTopicMove value);

		/// <summary>
		/// Merges the topics specified in <see cref="ForumTopicMerge"/>.
		/// </summary>
		/// <param name="value">The <see cref="ForumTopicMerge"/>.</param>
		void Merge(ForumTopicMerge value);

		/// <summary>
		/// Transforms the specified values that are selected to the topics list.
		/// </summary>
		/// <param name="values">The values.</param>
		/// <param name="topics">The topics.</param>
		void Transform(ForumTopicUpdateValue[] values, IList<ForumTopic> topics);

		/// <summary>
		/// Marks the topic as updated with the specified forum post.
		/// </summary>
		/// <param name="post">The post.</param>
		void MarkUpdated(ForumPost post);
	}
}